package com.damuzee.system.admin.service.impl;

import javax.annotation.Resource;

import org.mybatis.sql.page.Page;
import org.springframework.stereotype.Service;

import com.damuzee.system.admin.domain.EmpUser;
import com.damuzee.system.admin.persistence.EmpUserMapper;
import com.damuzee.system.admin.service.EmpUserUseService;

 @Service
public class EmpUserUseServiceImpl implements EmpUserUseService {
	
	public EmpUser adminLogin(String userName, String password) {
		EmpUser user = new EmpUser();
		user.setUserName(userName);
		user.setUserPwd(password);
		return userMapper.select(user);
	}
	
	public Page<EmpUser> getEmpUserList(Page<EmpUser> page, EmpUser empUser) {
		 
		return userMapper.selectPageByWhere( page, empUser);
	}
	
	public void saveUser(EmpUser user) {
		userMapper.insert(user); 
	}
	
	public EmpUserMapper getAdminUserMapper() {
		return userMapper;
	}

	public void setAdminUserMapper(EmpUserMapper userMapper) {
		this.userMapper = userMapper;
	}

 
	public EmpUser getAdminUser(EmpUser user) {
		 
		return userMapper.select(user);
	}

	@Resource
	private EmpUserMapper userMapper ;

}